$(document).ready(function() {
	var validator = $("#zhuceform").validate({
		rules: {
			create_password: {
				required: true,
				minlength: 6
			},
			repeat_password: {
				required: true,
				minlength: 6
			}
		},
		messages: {
			create_password: {
				required: "请输入新密码",
				rangelength: jQuery.format("请输入最少 {0} 个字符")
			},
			repeat_password: {
				required: "请重新输入新密码",
				rangelength: jQuery.format("请输入最少 {0} 个字符")
			}
		},
		// the errorPlacement has to take the table layout into account
		errorPlacement: function(error, element) {
			if ( element.is(":radio") )
				error.appendTo( element.parent().next().next() );
			else if ( element.is(":checkbox") )
				error.appendTo ( element.next() );
			else
				error.appendTo( element.parent().next() );
		},
		// set this class to error-labels to indicate valid fields
		success: function(label) {
			// set &nbsp; as text for IE
			label.html("&nbsp;").addClass("checked");
		}
	});
});
